app.service("goodsSpecificationService",function ($http) {

    //搜索
    this.search=function(page,rows){
        return $http.post('../goodsSpecificationController/findAll.do?pageNum='+page+"&pageSize="+rows,);
    }
    //增加
    this.add=function (entity) {
        return $http.post("../goodsSpecificationController/add.do",entity);
    }
    //查询实体
    this.findOne=function(id){
        return $http.get('../goodsSpecificationController/findOne.do?id='+id);
    }
    //修改
    this.update=function(entity){
        return  $http.post('../goodsSpecificationController/update.do',entity );
    }
    //删除规格
    this.delete=function(ids){
        return $http.post('../goodsSpecificationController/delete.do',ids);
    }
    //删除规格选项
    this.deleteOpt=function (id) {
        return $http.get("../goodsSpecificationController/deleteOpt.do?id="+id);
    }
    //选择 id 和 name
    this.selectSpecList=function () {
        return $http.get("../goodsSpecificationController/selectSpecList.do");
    }
});